package main

import (
	"GameApiServer/DBHelper"
	"GameApiServer/function"
	_ "GameApiServer/models"
	_ "GameApiServer/routers"
	"fmt"

	beego "github.com/beego/beego/v2/server/web"
	"github.com/beego/beego/v2/task"
)

var welcomeStr = `
 _       _____   _____       ___   __   _   _____  
| |     | ____| |_   _|     /   | |  \ | | /  ___| 
| |     | |__     | |      / /| | |   \| | | |     
| |     |  __|    | |     / / | | | |\   | | |  _  
| |___  | |___    | |    / /  | | | | \  | | |_| | 
|_____| |_____|   |_|   /_/   |_| |_|  \_| \_____/ 
`

func printWelcomeLogo() {
	fmt.Println(welcomeStr)
}

func main() {
	// 打印欢迎Logo
	printWelcomeLogo()
	// 初始化数据
	DBHelper.MySqlInit()
	// 初始化补单数据
	function.InitNoSuccessPayOrders()
	// 开启定时器任务
	function.TimerTaskInit()
	// 启动定时器任务
	task.StartTask()
	// 主方法退出,停止定时器任务
	defer task.StopTask()
	// 启动主循环
	beego.Run()
}
